﻿using IQIGame.Onigao.Framework;
using IQIGame.Onigao.Framework.Serialization;
using IQIGame.Onigao.GamePlay;

namespace IQIGame.Onigao.Logic
{
    public class SkillEffective_Prefab : SkillEffective
    {
        // public override void Execute(SkillEffectiveData rData, TargetSelect rTargetSelect, SelectParam rSelectParam, ref SkillEffectiveContext rContext, ref List<int> rTargetsGUID, int effectiveIndex)
        // {
        //     base.Execute(rData, rTargetSelect, rSelectParam, ref rContext, ref rTargetsGUID, effectiveIndex);
        // }

        protected override ISerializeCustomPOD OnExecute(SkillEffectiveData data, Unit target, SkillEffectiveContext context, int effectiveIndex, out SkillEffectiveResponse startResp)
        {
            startResp = null;
            var rResp = ClassPool.Get<SkillEffectivePackageResponse>();
            if (data.effectiveConfig.customConfig is SkillEffective_Prefab_ConfigData rConfig)
            {
                var rActions = rConfig.package.actions;
                return SkillEffective_Package.PackageOnExecute(rActions, target, ref context, effectiveIndex);
            }
            return rResp;
        }

#if UNITY_EDITOR
        public override string ToString(SkillCustomConfig config)
        {
            return $"预设";
        }
#endif
    }
}